/**
 * 
 */
package com.orange.handler.expert.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.orange.handler.expert.AuthExpertItemMapService;
import com.orange.modules.dao.expert.AuthExpertItemDataRepository;
import com.orange.modules.dao.expert.AuthExpertItemMapRepository;
import com.orange.modules.entity.AuthItem;
import com.orange.modules.entity.expert.AuthExpertItemData;
import com.orange.modules.entity.expert.AuthExpertItemMap;

/**
 * @author gaogs
 *
 * 2016-12-15
 */
@Service
public class AuthExpertItemMapServiceImpl implements AuthExpertItemMapService {

	@Autowired
	private AuthExpertItemMapRepository authExpertItemMapRepository;
	
	@Autowired
	private AuthExpertItemDataRepository authExpertItemDataRepository;
	
	/* (non-Javadoc)
	 * @see com.orange.handler.expert.AuthExpertItemMapService#saveAuthExpertItemMapList(java.util.List)
	 */
	@Override
	public void saveAuthExpertItemMapList(List<AuthExpertItemMap> list) {
		authExpertItemMapRepository.saveAuthExpertItemMapList(list);
	}

	/* (non-Javadoc)
	 * @see com.orange.handler.expert.AuthExpertItemMapService#deleteAuthExpertItemMapByExpertId(java.lang.String)
	 */
	@Override
	public void deleteAuthExpertItemMapByExpertId(String expertId,String schoolId)
			throws SQLException {
		authExpertItemMapRepository.deleteAuthExpertItemMapByExpertId(expertId, schoolId);
	}

	/* (non-Javadoc)
	 * @see com.orange.handler.expert.AuthExpertItemMapService#queryAuthExpertItemMapListByExpertId(java.lang.String)
	 */
	@Override
	public List<AuthExpertItemMap> queryAuthExpertItemMapListByExpertId(
			String expertId,String schoolId) throws SQLException {
		List<AuthExpertItemMap> list=authExpertItemMapRepository.queryAuthExpertItemMapListByExpertId(expertId,schoolId);
		return list;
	}

	@Override
	public List<AuthExpertItemData> queryAuthValueByItemId(String itemId)
			throws SQLException {
		List<AuthExpertItemData> list = authExpertItemDataRepository.queryAuthValueByItemId(itemId);
		return list;
	}

	@Override
	public AuthExpertItemData queryAuthItemsByExpertIdAndSchoolId(
			String expertId, String schoolId) throws SQLException {
		AuthExpertItemData ac = authExpertItemDataRepository.queryAuthItemsByExpertIdAndSchoolId(expertId, schoolId);
		return ac;
	}

	@Override
	public void saveAuthItemExpertData(AuthExpertItemData ad)
			throws SQLException {
		authExpertItemDataRepository.saveAuthItemExpertData(ad);
	}

	@Override
	public List<AuthExpertItemData> queryAuthItemInfo(String schoolId,
			String expertId, String itemId) throws SQLException {
		List<AuthExpertItemData> list = authExpertItemDataRepository.queryAuthItemInfo(schoolId, expertId, itemId);
		return list;
	}

	@Override
	public AuthExpertItemMap queryAuthExpertItemMapListByExpertId1(
			String expertId, String schoolId) throws SQLException {
		AuthExpertItemMap a = authExpertItemMapRepository.queryAuthExpertItemMapListByExpertId1(expertId, schoolId);
		return a;
	}

	@Override
	public void deleteAuthExpertItemData(String expertId, String type, String itemId,String schoolId) throws SQLException {
		authExpertItemDataRepository.deleteAuthExpertItemData(expertId, type, itemId,schoolId);
		
	}

	@Override
	public AuthExpertItemMap queryAuthExpertGroupByExpertId(String expertId)
			throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryAuthExpertGroupByExpertId(expertId);
		return ae;
	}

	@Override
	public List<AuthExpertItemMap> queryAuthSchoolGroupByGroupId(String groupId)
			throws SQLException {
		List<AuthExpertItemMap> ae = authExpertItemMapRepository.queryAuthSchoolGroupByGroupId(groupId);
		return ae;
	}

	@Override
	public AuthExpertItemMap queryAuthItemSchoolByGroupIdAndSchoolId(
			String groupId, String schoolId) throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryAuthExpertByItemIdAndSchoolId(groupId, schoolId);
		return ae;
	}

	@Override
	public AuthExpertItemMap queryAuthExpertByItemIdAndSchoolId(
			String schoolId, String itemId) throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryAuthExpertByItemIdAndSchoolId(schoolId, itemId);
		return ae;
	}

	@Override
	public AuthExpertItemMap queryitemByschoolId(String schoolId)
			throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryitemByschoolId(schoolId);
		return ae;
	}

	@Override
	public List<AuthExpertItemData> queryAuthAllItem(String itemId)
			throws SQLException {
		List<AuthExpertItemData> list = authExpertItemDataRepository.queryAuthAllItem(itemId);
		return list;
	}

	@Override
	public AuthExpertItemMap queryState(String schoolId, String itemId, String expertId) throws SQLException {
		AuthExpertItemMap map = authExpertItemMapRepository.queryState(schoolId, itemId, expertId);
		return map;
	}

	@Override
	public AuthExpertItemData queryMaterialInfo(String schoolId, String itemId,
			String expertId) throws SQLException {
		AuthExpertItemData ad = authExpertItemMapRepository.queryMaterialInfoByTwo(schoolId, itemId, expertId);
		return ad;
	}

	@Override
	public void saveAuthState(AuthExpertItemMap ae) {
		authExpertItemMapRepository.saveAuthState(ae);
		
	}

	@Override
	public AuthExpertItemData queryNumber(String schoolId, String type, String level)
			throws SQLException {
		AuthExpertItemData str = authExpertItemDataRepository.queryNumber(schoolId, type, level);
		return str;
	}

	@Override
	public AuthExpertItemMap queryGroupIdByExpertId(String expertId)
			throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryGroupIdByExpertId(expertId);
		return ae;
	}

	@Override
	public AuthExpertItemMap queryGroupIdByExpertId1(String expertId)
			throws SQLException {
		AuthExpertItemMap ae = authExpertItemMapRepository.queryGroupIdByExpertId1(expertId);
		return ae;
	}

}
